package com.chuanke.ckfamily.service.finance.impl.thread;

import com.chuanke.ckfamily.service.common.CacheService;
import com.chuanke.ckfamily.service.finance.GainPacketService;
import com.chuanke.ckfamily.service.util.SynizeThread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SynizeCacheToDbThread extends SynizeThread {

    private static Logger logger = LoggerFactory.getLogger(SynizeCacheToDbThread.class);

    private GainPacketService gainPacketService;

    public SynizeCacheToDbThread(CacheService cacheService,
                                 GainPacketService gainPacketService) {
        super(cacheService, CacheService.KEY_PREFIX.gain_packet_task_.name(), 20000);
        this.gainPacketService = gainPacketService;
    }


    protected boolean execute() {
        logger.debug("execute synizeCacheToDb ===============> ");
        return gainPacketService.synizeCacheToDb();
    }
}
